#ifndef _MODBUS_CFG_H
#define _MODBUS_CFG_H
#include "platform.h"
#include "Motor_Ext.h"
#include "LogicJudge_Ext.h"
#include "Protect_ext.h"
// #include "Modbus.h"

#ifndef MB_ENABLE
#define MB_ENABLE      (1)
#endif

#ifndef MB_DISABLE
#define MB_DISABLE      (0)
#endif

#define HMI_ADDR_FORMAT_0_BASE    ( 0x00 )
#define HMI_ADDR_FORMAT_1_BASE    ( 0x01 )
#define HMI_ADDR_FORMAT          HMI_ADDR_FORMAT_1_BASE  
#define MB_CRC_CHECK                (MB_ENABLE)

typedef enum{
    R = 0,//只读
    RW = 1//可读写
}em_ModbusRw;

typedef struct{
    uint16_t modbusAddr;   //modbus地址
    uint16_t *ramAddr;        //数据指针
    em_ModbusRw regRwType;//寄存器读写类型
}modbusReg_t;


#endif
